#ifndef __CHANNEL_HPP__
#define __CHANNEL_HPP__

#include <iostream>
#include <string>
class Channel
{
public:
    Channel(int wfd,int who)
        :_wfd(wfd),
        _who(who)
        {
            _name = "Channel-" + std::to_string(_wfd) + " " + std::to_string(_who);
        }
    std::string Name()
    {
        return _name;
    }
    int ID()
    {
        return _who;
    }
    int WFD()
    {
        return _wfd;
    }
    void Send(int task_t)
    {
        ::write(_wfd,&task_t,sizeof(task_t));
    }
    void Close()
    {
        ::close(_wfd);
    }
    ~Channel(){}
private:
    int _wfd;
    std::string _name;
    int _who;
};


















#endif 